import 'package:wanxiang_app/generated/json/base/json_field.dart';
import 'package:wanxiang_app/generated/json/goods_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class GoodsListEntity {
	late int code;
	late String msg;
	late List<GoodsListData> data;

	GoodsListEntity();

	factory GoodsListEntity.fromJson(Map<String, dynamic> json) => $GoodsListEntityFromJson(json);

	Map<String, dynamic> toJson() => $GoodsListEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GoodsListData {
	late int id;
	@JSONField(name: "is_self")
	late int isSelf;
	@JSONField(name: "img_url")
	late String imgUrl;
	@JSONField(name: "add_time")
	late String addTime;
	late String title;
	@JSONField(name: "category_text")
	late String categoryText;
	@JSONField(name: "sell_price")
	late String sellPrice;
	@JSONField(name: "is_deductible")
	String isDeductible = '';
	@JSONField(name: "channel_id")
	late String channelId;
	@JSONField(name: "baopei")
	late String baopei;

	@JSONField(name: "channel_name")
	late String channelName;

	late int totalcount;

	GoodsListData();

	factory GoodsListData.fromJson(Map<String, dynamic> json) => $GoodsListDataFromJson(json);

	Map<String, dynamic> toJson() => $GoodsListDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}